#ifndef CRC_H
#define CRC_H

#include "public_global.h"

//---------------------------------------------- myCCRC8 ---------------------
class PUBLICSHARED_EXPORT myCCRC8
{
private:
    unsigned char m_Table[256];
    bool m_bInvert;
public:
    myCCRC8(unsigned char Poly, bool bInvert);
    void CalculateCRC(unsigned char* pData, int nLength, unsigned char& CRC);
    static int add(int a,int b);
};

//---------------------------------------------- myCCRC16 ---------------------
class PUBLICSHARED_EXPORT myCCRC16
{
private:
    unsigned short m_wTable[256];
    bool m_bInvert;
public:
    myCCRC16(unsigned short wPoly, bool bInvert);
    void CalculateCRC(unsigned char* pData, int nLength, unsigned short& wCRC);
};


#endif // CRC_H
